home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / v9n20.arc / WIN_UD.XWS < prev    next >
Text File  |  1990-10-29  |  5KB  |  184 lines

  1. /*
  2.  
  3.    WIN_UD.XWS
  4.    PC MagNet Utilities Database download script.
  5.    Written for and with Crosstalk for Windows v1.1
  6.    by Rick Ayre. 8.24.90.
  7.  
  8. */
  9.  
  10. -- intialize variables, and make them EMPTY
  11. STRING FILE$, FILE1, FILE2, FILE3, FILE4, FILE5
  12.    FILE1 = "EMPTY"
  13.    FILE2 = "EMPTY"
  14.    FILE3 = "EMPTY"
  15.    FILE4 = "EMPTY"
  16.    FILE5 = "EMPTY"
  17.  
  18. -- dialogbox to get file names from user
  19. LABEL Get_File_Name
  20.    DIALOGBOX 61,20,196,58
  21.       LTEXT           40,4,120,8, 'PC MagNet Utilities Database'
  22.       LTEXT           65,12,70,8, 'Down Load Script'
  23.       LTEXT           22,24,70,8, 'Enter File Name:'
  24.       EDITTEXT        90,24,75,12,"",FILE$, TABSTOP FOCUS
  25.       DEFPUSHBUTTON   50,40,36,14,"Ok", OK TABSTOP
  26.       PUSHBUTTON      100,40,36,14,"Cancel", CANCEL TABSTOP
  27.    ENDDIALOG
  28.  
  29. -- put file names in variables
  30.    IF CHOICE = 2 THEN ...
  31.       GOTO On_Line
  32.          IF NULL(FILE$) THEN ...
  33.             GOTO Done_Yet
  34.                IF EXISTS(FILE$) THEN ...
  35.                   GOTO Get_Another
  36.                FILE5 = FILE4
  37.                FILE4 = FILE3
  38.                FILE3 = FILE2
  39.                FILE2 = FILE1
  40.                FILE1 = FILE$
  41.                IF FILE5 = "EMPTY" THEN ...
  42.                   GOTO Any_More
  43.                ELSE GOTO On_Line
  44.  
  45. -- if there are still EMPTY variables
  46. -- ask if user wants to name more files
  47. LABEL Any_More
  48.    RB1 = 0
  49.    RB2 = 1
  50.  
  51.    DIALOGBOX 81,20,136,75
  52.       LTEXT           33,14,80,10, 'Down Load Another'
  53.       RADIOBUTTON     48,22,24,12, "Yes", RB1, TABSTOP GROUP
  54.       RADIOBUTTON     48,34,24,12, "No", RB2, FOCUS
  55.       PUSHBUTTON      43,50,34,12, "Ok", OK TABSTOP
  56.    ENDDIALOG
  57.  
  58.    IF CHOICE = 2 OR RB2 THEN ...
  59.       GOTO On_Line
  60.    ELSE IF RB1 THEN ...
  61.       GOTO Get_File_Name
  62.  
  63. -- if user names no files
  64. -- ask if done
  65. LABEL Done_Yet
  66.    RB1 = 0
  67.    RB2 = 1
  68.  
  69.    DIALOGBOX 81,20,136,75
  70.       LTEXT           33,14,80,10, 'Are You Done?'
  71.       RADIOBUTTON     48,22,24,12, "Yes", RB1, TABSTOP GROUP
  72.       RADIOBUTTON     48,34,24,12, "No", RB2, FOCUS
  73.       PUSHBUTTON      43,50,34,12, "Ok", OK TABSTOP
  74.    ENDDIALOG
  75.  
  76.    IF CHOICE = 2 THEN ...
  77.       GOTO On_Line
  78.    ELSE IF RB1 THEN ...
  79.       GOTO Get_Off_And_Out
  80.    ELSE IF RB2 THEN ...
  81.       GOTO Get_File_Name
  82.  
  83. -- if file already exists in download directory
  84. -- ask if user wants a different file
  85. LABEL Get_Another
  86.    RB1 = 0
  87.    RB2 = 1
  88.  
  89.    DIALOGBOX 81,20,136,75
  90.       LTEXT           33,5,80,10, 'File Already Exists'
  91.       LTEXT           33,14,80,10, 'Care to try another?'
  92.       RADIOBUTTON     48,22,24,12, "Yes", RB1, TABSTOP GROUP
  93.       RADIOBUTTON     48,34,24,12, "No", RB2, FOCUS
  94.       PUSHBUTTON      43,50,34,12, "Ok", OK TABSTOP
  95.    ENDDIALOG
  96.  
  97.    IF CHOICE = 2 OR RB2 THEN ...
  98.       GOTO On_Line
  99.    ELSE IF RB1 THEN ...
  100.       GOTO Get_File_Name
  101.  
  102. -- if there are files to download
  103. -- load phone book entry and dial
  104. LABEL On_Line
  105.         IF FILE1 = "EMPTY" OR NULL(FILE1) THEN ...
  106.            END
  107.         ELSE CALL "PCMAGNET"
  108.         
  109. -- send ^C to wake up PC MagNet (compuserve)
  110.         WAIT 3 SECONDS
  111.         REPLY CHR(3);
  112.  
  113. -- wait for ^C echo; resend if we don't get it back
  114.         WAIT 7 SECONDS FOR '`^C'
  115.         IF TIMEOUT THEN ...
  116.            REPLY CHR(3);
  117.  
  118. -- send UserID & Password:
  119. -- these must already be entered in
  120. -- phone book entry
  121. LABEL Log_In
  122.         WAIT CASE 'ID:': REPLY UserID
  123.         WAIT CASE 'Password' : REPLY Password
  124.         WAIT "New"
  125.  
  126. -- navigate the PC MagNet Utilities Database
  127. LABEL Get_File
  128.         REPLY "Go pcm:utilit"
  129.         WAIT FOR "Search" : REPLY "4"
  130.         WAIT FOR "(example, DR.COM):" : REPLY FILE1
  131. -- if file cannot be found
  132. -- jump to routine to ask user what to do next
  133.         WATCH FOR
  134.            "ad this file? (Y/N)" : REPLY "y"
  135.            "!" : GOTO No_File
  136.         ENDWATCH
  137.         WAIT FOR "transfer!" : REPLY
  138.         WAIT FOR "!" : REPLY "5"
  139.         WAIT QUIET 5 SECONDS
  140.  
  141. -- as long as there are file names
  142. -- pass them to Get_File for download
  143. LABEL File_To_Get
  144.    FILE1 = FILE2
  145.    FILE2 = FILE3
  146.    FILE3 = FILE4
  147.    FILE4 = FILE5
  148.    FILE5 = "EMPTY"
  149.    IF FILE1 = "EMPTY" THEN ...
  150.       GOTO Get_Off_And_Out
  151.    ELSE GOTO Get_File
  152.  
  153. -- logoff PC MagNet, drop carrier, and end script
  154. LABEL Get_Off_And_Out
  155.    IF CONNECTED THEN
  156.    {
  157.       REPLY "Off" : OFF : BYE
  158.       CLEAR
  159.       PRINT "Thank you for using PC MagNet."
  160.       ALARM
  161.       END
  162.    }
  163.    ELSE ALARM
  164.    END
  165.  
  166. -- ask user what to do if the file
  167. -- cannot be found
  168. LABEL No_File
  169.    RB1 = 0
  170.    RB2 = 1
  171.  
  172.    DIALOGBOX 81,20,136,75
  173.       LTEXT           33,5,80,10, 'File not found'
  174.       LTEXT           33,14,80,10, 'Continue with others?'
  175.       RADIOBUTTON     48,22,24,12, "No", RB1, TABSTOP GROUP
  176.       RADIOBUTTON     48,34,24,12, "Yes", RB2, FOCUS
  177.       PUSHBUTTON      43,50,34,12, "Ok", OK TABSTOP
  178.    ENDDIALOG
  179.  
  180.    IF CHOICE = 2 OR RB1 THEN ...
  181.       GOTO Get_Off_And_Out
  182.    ELSE IF RB2 THEN GOTO File_To_Get
  183.    
  184.